<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      width: 300px;
      height: 300px;
      background: green;
      text-align: center;
      line-height: 300px;
    }

    .box .num {
      font-size: 50px;
    }
  </style>
</head>

<body>
  <div class="box">
    <span class="num">0</span>
  </div>

  <script>
    let box = document.querySelector(".box");
    let span = document.querySelector(".num");

    let num = 0;

    function jia() {
      num++;
      span.innerText = num;
    }

    function myThrottle(func, wait) {
      let time = null;

      return function () {

        if (!time) {
          time = setTimeout(() => {
            func();
            console.log(this);
            time = null;
          }, wait);
        }
      }
    }

    box.onmousemove = myThrottle(jia, 1000)

  </script>
</body>

</html>